<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script language="javascript" src="js/auswertung.js" type="text/javascript"> </script>
<script language="javascript" src="js/prototype.js" type="text/javascript"> </script>
<script language="javascript" src="js/deleteRun.js" type="text/javascript"> </script>
<script language="javascript" src="js/uebung.js" type="text/javascript"> </script>
<link rel="stylesheet" href="css/aufbau.css" />
<title>Feuerwehr Zeitauswertung</title>
</head>
<?php 
	include("php/db.php");
	include("php/saveRun.php");
?>

<body>
	<div id="nav">
    	<ul>
    		<li><a href="uebung.php">Übung</a></li>
            <li><a href="statistik.php">Statistik</a></li>
        </ul>
  <form method="post" action="endeUebung.php<?php echo "?ueb_id=".$_GET['ueb_id'];?>" name="uebdetails" >
  <table border="1">
  <tr>
    <th>Datum</th>
    <td><?php 
		$sqlDatum = "SELECT ueb_datum FROM t_uebung WHERE ueb_id=".$_GET['ueb_id'];
		$resDatum = $db->query($sqlDatum);
		$datum = $resDatum->fetch_assoc();
		echo $datum['ueb_datum'];
	?></td>
  </tr>
  <tr>
    <th>Beginn</th>
    <td><?php 
		$sqlBeginn = "SELECT ueb_beginn FROM t_uebung WHERE ueb_id=".$_GET['ueb_id'];
		$resBeginn = $db->query($sqlBeginn);
		$beginn = $resBeginn->fetch_assoc();
		echo $beginn['ueb_beginn'];
	?></td>
  </tr>
  <tr>
  	<?php 
		$sqlEnde = "SELECT ueb_ende FROM t_uebung WHERE ueb_id=".$_GET['ueb_id'];
		$resEnde = $db->query($sqlEnde);
		$ende = $resEnde->fetch_assoc();
		$time0 = "00:00:00";
		if(strcmp($ende['ueb_ende'],$time0) != 0)
			echo "<th>Ende</th><td>".$ende['ueb_ende']."</td>";
        else
        	echo "<td colspan=\"2\"><input type=\"submit\" value=\"Übung beenden\" /></td>";
	?>
  </tr>
</table>
</form>

    </div>

    <div id="content"> 
	<div id="auswertung">
    	<table id="tableAuswertung">
        	<tr>
            	<th>Auswertung</th>
                <th>Klasse:</th>
                <th id="ausKlasse"></th>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
            </tr>
        	<tr>
                <td>ausgelegt</td>
                <td></td>
                <td>Saugkopf fertig</td>
                <td></td>
                <td>kuppeln fertig</td>
                <td></td>
                <td>Leine angelegt</td>
                <td></td>
                <td>angesaugt</td>
                <td>Endzeit</td>
            </tr>
                    	<tr>
                <td id="ausAusgelegt"></td>
                <td></td>
                <td id="ausSaugkopfFertig"></td>
                <td></td>
                <td id="ausKuppelnFertig"></td>
                <td></td>
                <td id="ausLeineFertig"></td>
                <td></td>
                <td id="ausAngesaugt"></td>
                <td rowspan="3" id="ausEndzeit"></td>
            </tr>
                    	<tr>
                <td></td>
                <td id="ausSaugkopf"></td>
                <td></td>
                <td id="ausKuppeln"></td>
                <td></td>
                <td id="ausLeine"></td>
                <td></td>
                <td id="ausAnsaugen"></td>
                <td></td>
            </tr>
                                	<tr>
                <td></td>
                <td>Saugkopf</td>
                <td></td>
                <td>kuppeln</td>
                <td></td>
                <td>Leine anlegen</td>
                <td></td>
                <td>ansaugen</td>
                <td></td>
            </tr>
    	</table>
    </div>
    <div id="eingabe">
    	<h1>Eingabe</h1>
    	<form action="<? PHP_SELF ?>" method="post">
        	<table>
            	<tr>
                	<td>Bronze</td>
                    <td><input type="checkbox" name="bronze" value="b" tabindex="1"/></td>
                    <td>Fehlerpunkte</td>
                    <td><input type="text" name="fp" tabindex="7"/></td>
                </tr>
                <tr>
                	<td>ausgelegt</td>
                    <td><input type="text" name="ausgelegt" tabindex="2"/></td>
                </tr>
                <tr>
                    <td>Saugkopf fertig</td>
                    <td><input type="text" name="saugkopf" tabindex="3"/></td>
                    <td>Fehler</td>
                    <td>    <select name="fehler" size="1" tabindex="8">
                    	<option value="0" selected></option>
                    <?php
					$sqlFehler = 'SELECT * FROM t_fehlertext';
					$resFehler = $db->query($sqlFehler);
					while($fehler = $resFehler->fetch_assoc()){
						echo "<option value=\"".$fehler['feh_id']."\">".$fehler['feh_text']."</option>";
					}
					?>
    				</select></td>
                </tr>
                <tr>
                    <td>fertig gekuppelt</td>
                    <td><input type="text" name="kuppeln" tabindex="4"/></td>
                    <td rowspan="3">Kommentar</td>
                    <td rowspan="3"><textarea name="kommentar"  rows="2" tabindex="9"></textarea></td>
                </tr>
                <tr>
                    <td>Leine angelegt</td>
                    <td><input type="text" name="leine" tabindex="5"/></td>

                </tr>
                <tr>
                    <td>angesaugt</td>
                    <td><input type="text" name="angesaugt" tabindex="6"/></td>
 
                </tr>
        	</table>
            <br />
            <input type="submit" value="Speichern" tabindex="10"/>
		</form>
        <h1>Läufe</h1>
    </div>
    <div id="laeufe">
    	
		<?php include ("php/lauf.php"); ?>
    </div>
<?php include ("php/footer.php"); ?>